//
//  SPCellFactory.m
//  StayAwhile
//
//  Created by dllo on 16/1/28.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "SPCellFactory.h"
#import "TXPSPBaseTableViewCell.h"
#import "TXPSPBaseModel.h"
@implementation SPCellFactory

+(TXPSPBaseTableViewCell *)cellForSPModel:(TXPSPBaseModel *)basemodel{

  NSString *str =  [NSStringFromClass([basemodel class]) substringFromIndex:5];
  
    NSString *className =[@"CellForSP" stringByAppendingString:str];
    //字符串类名 转换成类
    Class cellClass = NSClassFromString(className);
    TXPSPBaseTableViewCell *cell =[[cellClass alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:NSStringFromClass([basemodel class])];
//      NSLog(@"%@",[basemodel class]);
    return cell;
}

@end
